package com.github.jspxnet.worktask.model.dto;

import com.github.jspxnet.boot.environment.Environment;
import com.github.jspxnet.enums.CongealEnumType;
import com.github.jspxnet.enums.RecycleEnumType;
import com.github.jspxnet.enums.YesNoEnumType;
import com.github.jspxnet.json.JsonIgnore;
import com.github.jspxnet.sober.annotation.Column;
import com.github.jspxnet.sober.annotation.Id;
import com.github.jspxnet.sober.annotation.Nexus;
import com.github.jspxnet.sober.annotation.Table;
import com.github.jspxnet.sober.enums.MappingType;
import com.github.jspxnet.sober.table.OperateTable;
import com.github.jspxnet.utils.StringUtil;
import com.github.jspxnet.worktask.table.ConfFlowNode;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created by jspx.net
 * author: chenYuan
 * date: 2021/9/27 23:35
 * description: jspx-framework
 **/
@EqualsAndHashCode(callSuper = true)
//@Table(caption = "流程配置",create = false)
@Data
public class ConfWorkFlowDto extends OperateTable {
    @Column(caption = "ID")
    private long id = 0;

    @Column(caption = "流程编号")
    private String flowNo = StringUtil.empty;

    @Column(caption = "节点ID")
    private String nodeId = StringUtil.empty;

    @Column(caption = "命名空间")
    private String namespace = StringUtil.empty;

    @Column(caption = "流程节点")
    private List<ConfFlowNodeDto> nodeList = new ArrayList<>();

    @Column(caption = "标题", length = 50, notNull = true)
    private String title = StringUtil.empty;

    @Column(caption = "备注", length = 250)
    private String note = StringUtil.empty;

    //关联字典表
    @Column(caption = "分类",length = 50)
    private String flowGroup = Environment.defaultValue;

    //配置
    @Column(caption = "归档",length = 2)
    private int canArchive = YesNoEnumType.YES.getValue();

    @Column(caption = "允许修改附件",length = 2)
    private int canEditAttachment = YesNoEnumType.YES.getValue();

    @Column(caption = "允许修改流程",length = 2)
    private int canModifyFlow = YesNoEnumType.YES.getValue();

    @Column(caption = "允许空意见",length = 2)
    private int canEmptyOpinion  = YesNoEnumType.YES.getValue();

    //流程期限
    @Column(caption = "流程期限")
    private Date limitDate = null;

    @Column(caption = "收到文件后几分钟提醒一次",option = "0:不提醒")
    private int tipMinute = 48;

    @Column(caption = "到期限后是否终结",option = "0:一直等待")
    private int limitDateEnd = YesNoEnumType.NO.getValue();

    @Column(caption = "督办人员", length = 4000)
    private String superviseUsers = StringUtil.empty;

    @Column(caption = "督办权限")
    private int supervisePower = 0;//SupervisePowerEnumType.NONE.getValue();

    @Column(caption = "冻结",length = 2, enumType = CongealEnumType.class , notNull = true)
    private int congealType = CongealEnumType.NO_CONGEAL.getValue();

    @JsonIgnore
    @Column(caption = "是否在回收站", length = 2, enumType = RecycleEnumType.class, notNull = true)
    private int recycleType = RecycleEnumType.NO_RECYCLE.getValue();

    @JsonIgnore
    @Column(caption = "回收时间", notNull = true)
    private Date recycleDate = new Date();

    @Column(caption = "排序", option = "0:默认;2:固顶;4:置顶;8:结对置顶;-1:下沉", notNull = true)
    private int sortType = 0;

    @JsonIgnore
    @Column(caption = "排序时间", notNull = true)
    private Date sortDate = new Date();


}
